#include <stdio.h>
int main()
{
	int a = 0;
	scanf_s("%d", &a);
	int i = 5,n=0; 
	int sum = 0,Sum=0;
	int A = a;
	
		while (i)
		{
			sum += A;
			A *= 10;
			Sum = Sum + sum;
			i--;
		}
		
	printf("%d\n", Sum);
	return 0;
}